$(function(){
  //get elem
  let $btn=$('input[type=button]'),
      delay=6,
      timer=null;
  //init status 设置按钮的初始状态 disable text delay
  $btn.val('同意('+delay+')s');
  $btn.attr('disabled','disabled');
  
  //start timer,timeout enable
  timer=setInterval(()=>{
    $btn.val('同意('+ --delay +')s');
    if(delay===0){
      clearInterval(timer);
      $btn.val('同意');
      $btn.removeAttr('disabled');
    }
  },1000)
  //click event
  $btn.click(()=>{
    alert('button clicked!');
  });

});
